home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Sound.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  66.5 KB  |  2,013 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Sound.a
  3. ;
  4. ;    Contains:    Sound Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Sound Manager 3.3
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1986-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  19. __SOUND__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  25.     include 'Dialogs.a'
  26.     ENDIF
  27.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  28.     include 'Components.a'
  29.     ENDIF
  30.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  31.     include 'MixedMode.a'
  32.     ENDIF
  33.     IF &TYPE('__MOVIES__') = 'UNDEFINED' THEN
  34.     include 'Movies.a'
  35.     ENDIF
  36.  
  37. ;                        * * *  N O T E  * * *
  38. ;
  39. ;    This file has been updated to include Sound Manager 3.3 interfaces.
  40. ;
  41. ;    Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  42. ;    that originally shipped with the PowerMacs. These missing functions and the
  43. ;    new 3.3 interfaces have been released in the SoundLib library for PowerPC
  44. ;    developers to link with. The runtime library for these functions are
  45. ;    installed by the Sound Manager. The following functions are found in SoundLib.
  46. ;
  47. ;        GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  48. ;        UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  49. ;        SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  50. ;        SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  51. ;        SoundConverterConvertBuffer(), SoundConverterEndConversion(),
  52. ;        AudioGetBass, AudioGetInfo, AudioGetMute, AudioGetOutputDevice,
  53. ;        AudioGetTreble, AudioGetVolume, AudioMuteOnEvent, AudioSetBass,
  54. ;        AudioSetMute, AudioSetToDefaults, AudioSetTreble, AudioSetVolume,
  55. ;        OpenMixerSoundComponent, CloseMixerSoundComponent, SoundComponentAddSource,
  56. ;        SoundComponentGetInfo, SoundComponentGetSource, SoundComponentGetSourceData,
  57. ;        SoundComponentInitOutputDevice, SoundComponentPauseSource,
  58. ;        SoundComponentPlaySourceBuffer, SoundComponentRemoveSource,
  59. ;        SoundComponentSetInfo, SoundComponentSetOutput, SoundComponentSetSource,
  60. ;        SoundComponentStartSource, SoundComponentStopSource
  61. ;        ParseAIFFHeader(), ParseSndHeader()
  62. ;
  63.  
  64. ;    Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  65. ;
  66. ;    These items are no longer defined, but appear here so that someone
  67. ;    searching the interfaces might find them. If you are using one of these
  68. ;    items, you must change your code to support the Sound Manager.
  69. ;
  70. ;        swMode, ftMode, ffMode
  71. ;        FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  72. ;        SndCompletionProcPtr
  73. ;        StartSound, StopSound, SoundDone
  74. ;
  75.  
  76.  
  77. ;  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  78. ;   constants
  79. ;  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  80.  
  81.  
  82.  
  83. soundListRsrc                    EQU        'snd '                ;Resource type used by Sound Manager
  84. rate48khz                        EQU        $BB800000            ;48000.00000 in fixed-point
  85. rate44khz                        EQU        $AC440000            ;44100.00000 in fixed-point
  86. rate22050hz                        EQU        $56220000            ;22050.00000 in fixed-point
  87. rate22khz                        EQU        $56EE8BA3            ;22254.54545 in fixed-point
  88. rate11khz                        EQU        $2B7745D1            ;11127.27273 in fixed-point
  89. rate11025hz                        EQU        $2B110000            ;11025.00000 in fixed-point
  90.                                                             ;synthesizer numbers for SndNewChannel
  91. squareWaveSynth                    EQU        1                    ;square wave synthesizer
  92. waveTableSynth                    EQU        3                    ;wave table synthesizer
  93. sampledSynth                    EQU        5                    ;sampled sound synthesizer
  94.                                                             ;old Sound Manager MACE synthesizer numbers
  95. MACE3snthID                        EQU        11
  96. MACE6snthID                        EQU        13
  97. kMiddleC                        EQU        60                    ;MIDI note value for middle C
  98. kSimpleBeepID                    EQU        1                    ;reserved resource ID for Simple Beep
  99. kFullVolume                        EQU        $0100                ;1.0, setting for full hardware output volume
  100. kNoVolume                        EQU        0                    ;setting for no sound volume
  101. stdQLength                        EQU        128
  102. dataOffsetFlag                    EQU        $8000
  103. kUseOptionalOutputDevice        EQU        -1                    ;only for Sound Manager 3.0 or later
  104. notCompressed                    EQU        0                    ;compression ID's
  105. fixedCompression                EQU        -1                    ;compression ID for fixed-sized compression
  106. variableCompression                EQU        -2                    ;compression ID for variable-sized compression
  107. twoToOne                        EQU        1
  108. eightToThree                    EQU        2
  109. threeToOne                        EQU        3
  110. sixToOne                        EQU        4
  111. sixToOnePacketSize                EQU        8
  112. threeToOnePacketSize            EQU        16
  113. stateBlockSize                    EQU        64
  114. leftOverBlockSize                EQU        32
  115. firstSoundFormat                EQU        $0001                ;general sound format
  116. secondSoundFormat                EQU        $0002                ;special sampled sound format (HyperCard)
  117. dbBufferReady                    EQU        $00000001            ;double buffer is filled
  118. dbLastBuffer                    EQU        $00000004            ;last double buffer to play
  119. sysBeepDisable                    EQU        $0000                ;SysBeep() enable flags
  120. sysBeepEnable                    EQU        $01
  121. sysBeepSynchronous                EQU        $02                    ;if bit set, make alert sounds synchronous
  122. unitTypeNoSelection                EQU        $FFFF                ;unitTypes for AudioSelection.unitType
  123. unitTypeSeconds                    EQU        $0000
  124.     IF TARGET_CPU_68K THEN
  125.  
  126. ;   PPCAsm thinks “extSH” is a directive and therefore can't be a constant (?)
  127. ;   But the 68k Asm needs to have these constants, so wrap them inside TARGET_CPU_68K
  128.  
  129.  
  130.  
  131. stdSH                            EQU        $00                    ;Standard sound header encode value
  132. extSH                            EQU        $FF                    ;Extended sound header encode value
  133. cmpSH                            EQU        $FE                    ;Compressed sound header encode value
  134.     ENDIF    ; TARGET_CPU_68K
  135. ; command numbers for SndDoCommand and SndDoImmediate
  136.  
  137. nullCmd                            EQU        0
  138. initCmd                            EQU        1
  139. freeCmd                            EQU        2
  140. quietCmd                        EQU        3
  141. flushCmd                        EQU        4
  142. reInitCmd                        EQU        5
  143. waitCmd                            EQU        10
  144. pauseCmd                        EQU        11
  145. resumeCmd                        EQU        12
  146. callBackCmd                        EQU        13
  147. syncCmd                            EQU        14
  148. availableCmd                    EQU        24
  149. versionCmd                        EQU        25
  150. totalLoadCmd                    EQU        26
  151. loadCmd                            EQU        27
  152. freqDurationCmd                    EQU        40
  153. restCmd                            EQU        41
  154. freqCmd                            EQU        42
  155. ampCmd                            EQU        43
  156. timbreCmd                        EQU        44
  157. getAmpCmd                        EQU        45
  158. volumeCmd                        EQU        46                    ;sound manager 3.0 or later only
  159. getVolumeCmd                    EQU        47                    ;sound manager 3.0 or later only
  160. clockComponentCmd                EQU        50                    ;sound manager 3.2.1 or later only
  161. getClockComponentCmd            EQU        51                    ;sound manager 3.2.1 or later only
  162. waveTableCmd                    EQU        60
  163. phaseCmd                        EQU        61
  164. soundCmd                        EQU        80
  165. bufferCmd                        EQU        81
  166. rateCmd                            EQU        82
  167. continueCmd                        EQU        83
  168. doubleBufferCmd                    EQU        84
  169. getRateCmd                        EQU        85
  170. rateMultiplierCmd                EQU        86
  171. getRateMultiplierCmd            EQU        87
  172. sizeCmd                            EQU        90                    ;obsolete command
  173. convertCmd                        EQU        91                    ;obsolete MACE command
  174.     IF OLDROUTINENAMES THEN
  175. ; channel initialization parameters
  176.  
  177. waveInitChannelMask                EQU        $07
  178. waveInitChannel0                EQU        $04                    ;wave table only, Sound Manager 2.0 and earlier
  179. waveInitChannel1                EQU        $05                    ;wave table only, Sound Manager 2.0 and earlier
  180. waveInitChannel2                EQU        $06                    ;wave table only, Sound Manager 2.0 and earlier
  181. waveInitChannel3                EQU        $07                    ;wave table only, Sound Manager 2.0 and earlier
  182. initChan0                        EQU        $04                    ;obsolete spelling
  183. initChan1                        EQU        $05                    ;obsolete spelling
  184. initChan2                        EQU        $06                    ;obsolete spelling
  185. initChan3                        EQU        $07                    ;obsolete spelling
  186.  
  187. outsideCmpSH                    EQU        0                    ;obsolete MACE constant
  188. insideCmpSH                        EQU        1                    ;obsolete MACE constant
  189. aceSuccess                        EQU        0                    ;obsolete MACE constant
  190. aceMemFull                        EQU        1                    ;obsolete MACE constant
  191. aceNilBlock                        EQU        2                    ;obsolete MACE constant
  192. aceBadComp                        EQU        3                    ;obsolete MACE constant
  193. aceBadEncode                    EQU        4                    ;obsolete MACE constant
  194. aceBadDest                        EQU        5                    ;obsolete MACE constant
  195. aceBadCmd                        EQU        6                    ;obsolete MACE constant
  196.     ENDIF    ; OLDROUTINENAMES
  197.  
  198. initChanLeft                    EQU        $0002                ;left stereo channel
  199. initChanRight                    EQU        $0003                ;right stereo channel
  200. initNoInterp                    EQU        $0004                ;no linear interpolation
  201. initNoDrop                        EQU        $0008                ;no drop-sample conversion
  202. initMono                        EQU        $0080                ;monophonic channel
  203. initStereo                        EQU        $00C0                ;stereo channel
  204. initMACE3                        EQU        $0300                ;MACE 3:1
  205. initMACE6                        EQU        $0400                ;MACE 6:1
  206. initPanMask                        EQU        $0003                ;mask for right/left pan values
  207. initSRateMask                    EQU        $0030                ;mask for sample rate values
  208. initStereoMask                    EQU        $00C0                ;mask for mono/stereo values
  209. initCompMask                    EQU        $FF00                ;mask for compression IDs
  210. ; Get&Set Sound Information Selectors
  211.  
  212. siActiveChannels                EQU        'chac'                ;active channels
  213. siActiveLevels                    EQU        'lmac'                ;active meter levels
  214. siAGCOnOff                        EQU        'agc '                ;automatic gain control state
  215. siAsync                            EQU        'asyn'                ;asynchronous capability
  216. siAVDisplayBehavior                EQU        'avdb'
  217. siChannelAvailable                EQU        'chav'                ;number of channels available
  218. siCompressionAvailable            EQU        'cmav'                ;compression types available
  219. siCompressionFactor                EQU        'cmfa'                ;current compression factor
  220. siCompressionHeader                EQU        'cmhd'                ;return compression header
  221. siCompressionNames                EQU        'cnam'                ;compression type names available
  222. siCompressionParams                EQU        'cmpp'                ;compression parameters
  223. siCompressionType                EQU        'comp'                ;current compression type
  224. siContinuous                    EQU        'cont'                ;continous recording
  225. siDeviceBufferInfo                EQU        'dbin'                ;size of interrupt buffer
  226. siDeviceConnected                EQU        'dcon'                ;input device connection status
  227. siDeviceIcon                    EQU        'icon'                ;input device icon
  228. siDeviceName                    EQU        'name'                ;input device name
  229. siHardwareBalance                EQU        'hbal'
  230. siHardwareBalanceSteps            EQU        'hbls'
  231. siHardwareBass                    EQU        'hbas'
  232. siHardwareBassSteps                EQU        'hbst'
  233. siHardwareBusy                    EQU        'hwbs'                ;sound hardware is in use
  234. siHardwareFormat                EQU        'hwfm'                ;get hardware format
  235. siHardwareMute                    EQU        'hmut'                ;mute state of all hardware
  236. siHardwareTreble                EQU        'htrb'
  237. siHardwareTrebleSteps            EQU        'hwts'
  238. siHardwareVolume                EQU        'hvol'                ;volume level of all hardware
  239. siHardwareVolumeSteps            EQU        'hstp'                ;number of volume steps for hardware
  240. siHeadphoneMute                    EQU        'pmut'                ;mute state of headphones
  241. siHeadphoneVolume                EQU        'pvol'                ;volume level of headphones
  242. siHeadphoneVolumeSteps            EQU        'hdst'                ;number of volume steps for headphones
  243. siInputAvailable                EQU        'inav'                ;input sources available
  244. siInputGain                        EQU        'gain'                ;input gain
  245. siInputSource                    EQU        'sour'                ;input source selector
  246. siInputSourceNames                EQU        'snam'                ;input source names
  247. siLevelMeterOnOff                EQU        'lmet'                ;level meter state
  248. siModemGain                        EQU        'mgai'                ;modem input gain
  249. siMonitorAvailable                EQU        'mnav'
  250. siMonitorSource                    EQU        'mons'
  251. siNumberChannels                EQU        'chan'                ;current number of channels
  252. siOptionsDialog                    EQU        'optd'                ;display options dialog
  253. siPlayThruOnOff                    EQU        'plth'                ;playthrough state
  254. siPostMixerSoundComponent        EQU        'psmx'                ;install post-mixer effect
  255. siPreMixerSoundComponent        EQU        'prmx'                ;install pre-mixer effect
  256. siQuality                        EQU        'qual'                ;quality setting
  257. siRateMultiplier                EQU        'rmul'                ;throttle rate setting
  258. siRecordingQuality                EQU        'qual'                ;recording quality
  259. siSampleRate                    EQU        'srat'                ;current sample rate
  260. siSampleRateAvailable            EQU        'srav'                ;sample rates available
  261. siSampleSize                    EQU        'ssiz'                ;current sample size
  262. siSampleSizeAvailable            EQU        'ssav'                ;sample sizes available
  263. siSetupCDAudio                    EQU        'sucd'                ;setup sound hardware for CD audio
  264. siSetupModemAudio                EQU        'sumd'                ;setup sound hardware for modem audio
  265. siSlopeAndIntercept                EQU        'flap'                ;floating point variables for conversion
  266. siSoundClock                    EQU        'sclk'
  267. siSpeakerMute                    EQU        'smut'                ;mute state of all built-in speaker
  268. siSpeakerVolume                    EQU        'svol'                ;volume level of built-in speaker
  269. siSSpCPULoadLimit                EQU        '3dll'
  270. siSSpLocalization                EQU        '3dif'
  271. siSSpSpeakerSetup                EQU        '3dst'
  272. siStereoInputGain                EQU        'sgai'                ;stereo input gain
  273. siSubwooferMute                    EQU        'bmut'                ;mute state of sub-woofer
  274. siTwosComplementOnOff            EQU        'twos'                ;two's complement state
  275. siVolume                        EQU        'volu'                ;volume level of source
  276. siVoxRecordInfo                    EQU        'voxr'                ;VOX record parameters
  277. siVoxStopInfo                    EQU        'voxs'                ;VOX stop parameters
  278. siWideStereo                    EQU        'wide'                ;wide stereo setting
  279.  
  280. siCloseDriver                    EQU        'clos'                ;reserved for internal use only
  281. siInitializeDriver                EQU        'init'                ;reserved for internal use only
  282. siPauseRecording                EQU        'paus'                ;reserved for internal use only
  283. siUserInterruptProc                EQU        'user'                ;reserved for internal use only
  284. ; Sound Component Types and Subtypes
  285.  
  286. kNoSoundComponentType            EQU        '****'
  287. kSoundComponentType                EQU        'sift'                ;component type
  288. kSoundComponentPPCType            EQU        'nift'                ;component type for PowerPC code
  289. kRate8SubType                    EQU        'ratb'                ;8-bit rate converter
  290. kRate16SubType                    EQU        'ratw'                ;16-bit rate converter
  291. kConverterSubType                EQU        'conv'                ;sample format converter
  292. kSndSourceSubType                EQU        'sour'                ;generic source component
  293. kMixerType                        EQU        'mixr'
  294. kMixer8SubType                    EQU        'mixb'                ;8-bit mixer
  295. kMixer16SubType                    EQU        'mixw'                ;16-bit mixer
  296. kSoundOutputDeviceType            EQU        'sdev'                ;sound output component
  297. kClassicSubType                    EQU        'clas'                ;classic hardware, i.e. Mac Plus
  298. kASCSubType                        EQU        'asc '                ;Apple Sound Chip device
  299. kDSPSubType                        EQU        'dsp '                ;DSP device
  300. kAwacsSubType                    EQU        'awac'                ;Another of Will's Audio Chips device
  301. kGCAwacsSubType                    EQU        'awgc'                ;Awacs audio with Grand Central DMA
  302. kSingerSubType                    EQU        'sing'                ;Singer (via Whitney) based sound
  303. kSinger2SubType                    EQU        'sng2'                ;Singer 2 (via Whitney) for Acme
  304. kWhitSubType                    EQU        'whit'                ;Whit sound component for PrimeTime 3
  305. kSoundBlasterSubType            EQU        'sbls'                ;Sound Blaster for CHRP
  306. kSoundCompressor                EQU        'scom'
  307. kSoundDecompressor                EQU        'sdec'
  308. kSoundEffectsType                EQU        'snfx'                ;sound effects type
  309. kSSpLocalizationSubType            EQU        'snd3'
  310. ; Format Types
  311.  
  312. kSoundNotCompressed                EQU        'NONE'                ;sound is not compressed
  313. kOffsetBinary                    EQU        'raw '                ;offset binary
  314. kMACE3Compression                EQU        'MAC3'                ;MACE 3:1
  315. kMACE6Compression                EQU        'MAC6'                ;MACE 6:1
  316. kCDXA4Compression                EQU        'cdx4'                ;CD/XA 4:1
  317. kCDXA2Compression                EQU        'cdx2'                ;CD/XA 2:1
  318. kIMACompression                    EQU        'ima4'                ;IMA 4:1
  319. kULawCompression                EQU        'ulaw'                ;µLaw 2:1
  320. kALawCompression                EQU        'alaw'                ;aLaw 2:1
  321. kLittleEndianFormat                EQU        'sowt'                ;Little-endian
  322. kFloat32Format                    EQU        'fl32'                ;32-bit floating point
  323. kFloat64Format                    EQU        'fl64'                ;64-bit floating point
  324. kTwosComplement                    EQU        'twos'                ;old name for compatibility
  325. ; Features Flags
  326.  
  327. k8BitRawIn                        EQU        $01                    ;data description
  328. k8BitTwosIn                        EQU        $02
  329. k16BitIn                        EQU        $04
  330. kStereoIn                        EQU        $08
  331. k8BitRawOut                        EQU        $0100
  332. k8BitTwosOut                    EQU        $0200
  333. k16BitOut                        EQU        $0400
  334. kStereoOut                        EQU        $0800
  335. kReverse                        EQU        $00010000            ;  function description
  336. kRateConvert                    EQU        $00020000
  337. kCreateSoundSource                EQU        $00040000
  338. kHighQuality                    EQU        $00400000            ;  performance description
  339. kNonRealTime                    EQU        $00800000
  340. ; SoundComponentPlaySourceBuffer action flags
  341.  
  342. kSourcePaused                    EQU        $01
  343. kPassThrough                    EQU        $00010000
  344. kNoSoundComponentChain            EQU        $00020000
  345. ; SoundParamBlock flags, usefull for OpenMixerSoundComponent
  346.  
  347. kNoMixing                        EQU        $01                    ;don't mix source
  348. kNoSampleRateConversion            EQU        $02                    ;don't convert sample rate (i.e. 11 kHz -> 22 kHz)
  349. kNoSampleSizeConversion            EQU        $04                    ;don't convert sample size (i.e. 16 -> 8)
  350. kNoSampleFormatConversion        EQU        $08                    ;don't convert sample format (i.e. 'twos' -> 'raw ')
  351. kNoChannelConversion            EQU        $10                    ;don't convert stereo/mono
  352. kNoDecompression                EQU        $20                    ;don't decompress (i.e. 'MAC3' -> 'raw ')
  353. kNoVolumeConversion                EQU        $40                    ;don't apply volume
  354. kNoRealtimeProcessing            EQU        $80                    ;won't run at interrupt time
  355. kScheduledSource                EQU        $0100                ;source is scheduled
  356. ; SoundParamBlock quality settings
  357.  
  358. kBestQuality                    EQU        $01                    ;use interpolation in rate conversion
  359. ; useful bit masks
  360.  
  361. kInputMask                        EQU        $000000FF            ;masks off input bits
  362. kOutputMask                        EQU        $0000FF00            ;masks off output bits
  363. kOutputShift                    EQU        8                    ;amount output bits are shifted
  364. kActionMask                        EQU        $00FF0000            ;masks off action bits
  365. kSoundComponentBits                EQU        $00FFFFFF
  366. ; siAVDisplayBehavior types
  367.  
  368. kAVDisplayHeadphoneRemove        EQU        0                    ; monitor does not have a headphone attached
  369. kAVDisplayHeadphoneInsert        EQU        1                    ; monitor has a headphone attached
  370. kAVDisplayPlainTalkRemove        EQU        2                    ; monitor either sending no input through CPU input port or unable to tell if input is coming in
  371. kAVDisplayPlainTalkInsert        EQU        3                    ; monitor sending PlainTalk level microphone source input through sound input port
  372. ; Audio Component constants
  373.  
  374.                                                             ;Values for whichChannel parameter
  375. audioAllChannels                EQU        0                    ;All channels (usually interpreted as both left and right)
  376. audioLeftChannel                EQU        1                    ;Left channel
  377. audioRightChannel                EQU        2                    ;Right channel
  378.                                                             ;Values for mute parameter
  379. audioUnmuted                    EQU        0                    ;Device is unmuted
  380. audioMuted                        EQU        1                    ;Device is muted
  381.                                                             ;Capabilities flags definitions
  382. audioDoesMono                    EQU        $00000001            ;Device supports mono output
  383. audioDoesStereo                    EQU        $00000002            ;Device supports stereo output
  384. audioDoesIndependentChannels    EQU        $00000004            ;Device supports independent software control of each channel
  385. ; Sound Input Qualities
  386.  
  387. siCDQuality                        EQU        'cd  '                ;44.1kHz, stereo, 16 bit
  388. siBestQuality                    EQU        'best'                ;22kHz, mono, 8 bit
  389. siBetterQuality                    EQU        'betr'                ;22kHz, mono, MACE 3:1
  390. siGoodQuality                    EQU        'good'                ;22kHz, mono, MACE 6:1
  391.  
  392. siDeviceIsConnected                EQU        1                    ;input device is connected and ready for input
  393. siDeviceNotConnected            EQU        0                    ;input device is not connected
  394. siDontKnowIfConnected            EQU        -1                    ;can't tell if input device is connected
  395. siReadPermission                EQU        0                    ;permission passed to SPBOpenDevice
  396. siWritePermission                EQU        1                    ;permission passed to SPBOpenDevice
  397.  
  398. ;  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  399. ;   typedefs
  400. ;  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  401.  
  402.  
  403.  
  404. SndCommand                RECORD 0
  405. cmd                         ds.w    1                ; offset: $0 (0)
  406. param1                     ds.w    1                ; offset: $2 (2)
  407. param2                     ds.l    1                ; offset: $4 (4)
  408. sizeof                     EQU *                    ; size:   $8 (8)
  409.                         ENDR
  410.  
  411.  
  412. ; typedef SndChannel *                    SndChannelPtr
  413.  
  414. SndChannel                RECORD 0
  415. nextChan                 ds.l    1                ; offset: $0 (0)
  416. firstMod                 ds.l    1                ; offset: $4 (4)        ;  reserved for the Sound Manager 
  417. callBack                 ds.l    1                ; offset: $8 (8)
  418. userInfo                 ds.l    1                ; offset: $C (12)
  419. wait                     ds.l    1                ; offset: $10 (16)        ;  The following is for internal Sound Manager use only.
  420. cmdInProgress             ds        SndCommand        ; offset: $14 (20)
  421. flags                     ds.w    1                ; offset: $1C (28)
  422. qLength                     ds.w    1                ; offset: $1E (30)
  423. qHead                     ds.w    1                ; offset: $20 (32)
  424. qTail                     ds.w    1                ; offset: $22 (34)
  425. queue                     ds.b    128 * SndCommand.sizeof ; offset: $24 (36)
  426. sizeof                     EQU *                    ; size:   $424 (1060)
  427.                         ENDR
  428. ; MACE structures
  429. StateBlock                RECORD 0
  430. stateVar                 ds.w    64                ; offset: $0 (0)
  431. sizeof                     EQU *                    ; size:   $80 (128)
  432.                         ENDR
  433. ; typedef struct StateBlock *            StateBlockPtr
  434.  
  435. LeftOverBlock            RECORD 0
  436. count                     ds.l    1                ; offset: $0 (0)
  437. sampleArea                 ds.b    32                ; offset: $4 (4)
  438. sizeof                     EQU *                    ; size:   $24 (36)
  439.                         ENDR
  440. ; typedef struct LeftOverBlock *        LeftOverBlockPtr
  441.  
  442. ModRef                    RECORD 0
  443. modNumber                 ds.w    1                ; offset: $0 (0)
  444. modInit                     ds.l    1                ; offset: $2 (2)
  445. sizeof                     EQU *                    ; size:   $6 (6)
  446.                         ENDR
  447. SndListResource            RECORD 0
  448. format                     ds.w    1                ; offset: $0 (0)
  449. numModifiers             ds.w    1                ; offset: $2 (2)
  450. modifierPart             ds        ModRef            ; offset: $4 (4) <-- really an array of length one
  451. numCommands                 ds.w    1                ; offset: $A (10)
  452. commandPart                 ds        SndCommand        ; offset: $C (12) <-- really an array of length one
  453. dataPart                 ds.b    1                ; offset: $14 (20) <-- really an array of length one
  454.                          ORG 22
  455. sizeof                     EQU *                    ; size:   $16 (22)
  456.                         ENDR
  457. ; typedef struct SndListResource *        SndListPtr
  458.  
  459. ; typedef SndListPtr *                    SndListHndl
  460.  
  461. ; typedef SndListPtr *                    SndListHandle
  462.  
  463. ; HyperCard sound resource format
  464. Snd2ListResource        RECORD 0
  465. format                     ds.w    1                ; offset: $0 (0)
  466. refCount                 ds.w    1                ; offset: $2 (2)
  467. numCommands                 ds.w    1                ; offset: $4 (4)
  468. commandPart                 ds        SndCommand        ; offset: $6 (6) <-- really an array of length one
  469. dataPart                 ds.b    1                ; offset: $E (14) <-- really an array of length one
  470.                          ORG 16
  471. sizeof                     EQU *                    ; size:   $10 (16)
  472.                         ENDR
  473. ; typedef struct Snd2ListResource *        Snd2ListPtr
  474.  
  475. ; typedef Snd2ListPtr *                    Snd2ListHndl
  476.  
  477. ; typedef Snd2ListPtr *                    Snd2ListHandle
  478.  
  479. SoundHeader                RECORD 0
  480. samplePtr                 ds.l    1                ; offset: $0 (0)        ; if NIL then samples are in sampleArea
  481. length                     ds.l    1                ; offset: $4 (4)        ; length of sound in bytes
  482. sampleRate                 ds.l    1                ; offset: $8 (8)        ; sample rate for this sound
  483. loopStart                 ds.l    1                ; offset: $C (12)        ; start of looping portion
  484. loopEnd                     ds.l    1                ; offset: $10 (16)        ; end of looping portion
  485. encode                     ds.b    1                ; offset: $14 (20)        ; header encoding
  486. baseFrequency             ds.b    1                ; offset: $15 (21)        ; baseFrequency value
  487. sampleArea                 ds.b    1                ; offset: $16 (22) <-- really an array of length one ; space for when samples follow directly
  488.                          ORG 24
  489. sizeof                     EQU *                    ; size:   $18 (24)
  490.                         ENDR
  491. ; typedef struct SoundHeader *            SoundHeaderPtr
  492.  
  493. CmpSoundHeader            RECORD 0
  494. samplePtr                 ds.l    1                ; offset: $0 (0)        ; if nil then samples are in sample area
  495. numChannels                 ds.l    1                ; offset: $4 (4)        ; number of channels i.e. mono = 1
  496. sampleRate                 ds.l    1                ; offset: $8 (8)        ; sample rate in Apples Fixed point representation
  497. loopStart                 ds.l    1                ; offset: $C (12)        ; loopStart of sound before compression
  498. loopEnd                     ds.l    1                ; offset: $10 (16)        ; loopEnd of sound before compression
  499. encode                     ds.b    1                ; offset: $14 (20)        ; data structure used , stdSH, extSH, or cmpSH
  500. baseFrequency             ds.b    1                ; offset: $15 (21)        ; same meaning as regular SoundHeader
  501. numFrames                 ds.l    1                ; offset: $16 (22)        ; length in frames ( packetFrames or sampleFrames )
  502. AIFFSampleRate             ds        extended80        ; offset: $1A (26)        ; IEEE sample rate
  503. markerChunk                 ds.l    1                ; offset: $24 (36)        ; sync track
  504. format                     ds.l    1                ; offset: $28 (40)        ; data format type, was futureUse1
  505. futureUse2                 ds.l    1                ; offset: $2C (44)        ; reserved by Apple
  506. stateVars                 ds.l    1                ; offset: $30 (48)        ; pointer to State Block
  507. leftOverSamples             ds.l    1                ; offset: $34 (52)        ; used to save truncated samples between compression calls
  508. compressionID             ds.w    1                ; offset: $38 (56)        ; 0 means no compression, non zero means compressionID
  509. packetSize                 ds.w    1                ; offset: $3A (58)        ; number of bits in compressed sample packet
  510. snthID                     ds.w    1                ; offset: $3C (60)        ; resource ID of Sound Manager snth that contains NRT C/E
  511. sampleSize                 ds.w    1                ; offset: $3E (62)        ; number of bits in non-compressed sample
  512. sampleArea                 ds.b    1                ; offset: $40 (64) <-- really an array of length one ; space for when samples follow directly
  513.                          ORG 66
  514. sizeof                     EQU *                    ; size:   $42 (66)
  515.                         ENDR
  516. ; typedef struct CmpSoundHeader *        CmpSoundHeaderPtr
  517.  
  518. ExtSoundHeader            RECORD 0
  519. samplePtr                 ds.l    1                ; offset: $0 (0)        ; if nil then samples are in sample area
  520. numChannels                 ds.l    1                ; offset: $4 (4)        ; number of channels,  ie mono = 1
  521. sampleRate                 ds.l    1                ; offset: $8 (8)        ; sample rate in Apples Fixed point representation
  522. loopStart                 ds.l    1                ; offset: $C (12)        ; same meaning as regular SoundHeader
  523. loopEnd                     ds.l    1                ; offset: $10 (16)        ; same meaning as regular SoundHeader
  524. encode                     ds.b    1                ; offset: $14 (20)        ; data structure used , stdSH, extSH, or cmpSH
  525. baseFrequency             ds.b    1                ; offset: $15 (21)        ; same meaning as regular SoundHeader
  526. numFrames                 ds.l    1                ; offset: $16 (22)        ; length in total number of frames
  527. AIFFSampleRate             ds        extended80        ; offset: $1A (26)        ; IEEE sample rate
  528. markerChunk                 ds.l    1                ; offset: $24 (36)        ; sync track
  529. instrumentChunks         ds.l    1                ; offset: $28 (40)        ; AIFF instrument chunks
  530. AESRecording             ds.l    1                ; offset: $2C (44)
  531. sampleSize                 ds.w    1                ; offset: $30 (48)        ; number of bits in sample
  532. futureUse1                 ds.w    1                ; offset: $32 (50)        ; reserved by Apple
  533. futureUse2                 ds.l    1                ; offset: $34 (52)        ; reserved by Apple
  534. futureUse3                 ds.l    1                ; offset: $38 (56)        ; reserved by Apple
  535. futureUse4                 ds.l    1                ; offset: $3C (60)        ; reserved by Apple
  536. sampleArea                 ds.b    1                ; offset: $40 (64) <-- really an array of length one ; space for when samples follow directly
  537.                          ORG 66
  538. sizeof                     EQU *                    ; size:   $42 (66)
  539.                         ENDR
  540. ; typedef struct ExtSoundHeader *        ExtSoundHeaderPtr
  541.  
  542. SoundHeaderUnion        RECORD 0
  543. stdHeader                 ds        SoundHeader        ; offset: $0 (0)
  544.                          ORG 0
  545. cmpHeader                 ds        CmpSoundHeader ; offset: $0 (0)
  546.                          ORG 0
  547. extHeader                 ds        ExtSoundHeader ; offset: $0 (0)
  548. sizeof                     EQU *                    ; size:   $42 (66)
  549.                         ENDR
  550. ConversionBlock            RECORD 0
  551. destination                 ds.w    1                ; offset: $0 (0)
  552. unused                     ds.w    1                ; offset: $2 (2)
  553. inputPtr                 ds.l    1                ; offset: $4 (4)
  554. outputPtr                 ds.l    1                ; offset: $8 (8)
  555. sizeof                     EQU *                    ; size:   $C (12)
  556.                         ENDR
  557. ; typedef struct ConversionBlock *        ConversionBlockPtr
  558.  
  559. SMStatus                RECORD 0
  560. smMaxCPULoad             ds.w    1                ; offset: $0 (0)
  561. smNumChannels             ds.w    1                ; offset: $2 (2)
  562. smCurCPULoad             ds.w    1                ; offset: $4 (4)
  563. sizeof                     EQU *                    ; size:   $6 (6)
  564.                         ENDR
  565. ; typedef struct SMStatus *                SMStatusPtr
  566.  
  567. SCStatus                RECORD 0
  568. scStartTime                 ds.l    1                ; offset: $0 (0)
  569. scEndTime                 ds.l    1                ; offset: $4 (4)
  570. scCurrentTime             ds.l    1                ; offset: $8 (8)
  571. scChannelBusy             ds.b    1                ; offset: $C (12)
  572. scChannelDisposed         ds.b    1                ; offset: $D (13)
  573. scChannelPaused             ds.b    1                ; offset: $E (14)
  574. scUnused                 ds.b    1                ; offset: $F (15)
  575. scChannelAttributes         ds.l    1                ; offset: $10 (16)
  576. scCPULoad                 ds.l    1                ; offset: $14 (20)
  577. sizeof                     EQU *                    ; size:   $18 (24)
  578.                         ENDR
  579. ; typedef struct SCStatus *                SCStatusPtr
  580.  
  581. AudioSelection            RECORD 0
  582. unitType                 ds.l    1                ; offset: $0 (0)
  583. selStart                 ds.l    1                ; offset: $4 (4)
  584. selEnd                     ds.l    1                ; offset: $8 (8)
  585. sizeof                     EQU *                    ; size:   $C (12)
  586.                         ENDR
  587. ; typedef struct AudioSelection *        AudioSelectionPtr
  588.  
  589. SndDoubleBuffer            RECORD 0
  590. dbNumFrames                 ds.l    1                ; offset: $0 (0)
  591. dbFlags                     ds.l    1                ; offset: $4 (4)
  592. dbUserInfo                 ds.l    2                ; offset: $8 (8)
  593. dbSoundData                 ds.b    1                ; offset: $10 (16) <-- really an array of length one
  594.                          ORG 18
  595. sizeof                     EQU *                    ; size:   $12 (18)
  596.                         ENDR
  597. ; typedef struct SndDoubleBuffer *        SndDoubleBufferPtr
  598.  
  599. SndDoubleBufferHeader    RECORD 0
  600. dbhNumChannels             ds.w    1                ; offset: $0 (0)
  601. dbhSampleSize             ds.w    1                ; offset: $2 (2)
  602. dbhCompressionID         ds.w    1                ; offset: $4 (4)
  603. dbhPacketSize             ds.w    1                ; offset: $6 (6)
  604. dbhSampleRate             ds.l    1                ; offset: $8 (8)
  605. dbhBufferPtr             ds.l    2                ; offset: $C (12)
  606. dbhDoubleBack             ds.l    1                ; offset: $14 (20)
  607. sizeof                     EQU *                    ; size:   $18 (24)
  608.                         ENDR
  609. ; typedef struct SndDoubleBufferHeader * SndDoubleBufferHeaderPtr
  610.  
  611. SndDoubleBufferHeader2    RECORD 0
  612. dbhNumChannels             ds.w    1                ; offset: $0 (0)
  613. dbhSampleSize             ds.w    1                ; offset: $2 (2)
  614. dbhCompressionID         ds.w    1                ; offset: $4 (4)
  615. dbhPacketSize             ds.w    1                ; offset: $6 (6)
  616. dbhSampleRate             ds.l    1                ; offset: $8 (8)
  617. dbhBufferPtr             ds.l    2                ; offset: $C (12)
  618. dbhDoubleBack             ds.l    1                ; offset: $14 (20)
  619. dbhFormat                 ds.l    1                ; offset: $18 (24)
  620. sizeof                     EQU *                    ; size:   $1C (28)
  621.                         ENDR
  622. ; typedef struct SndDoubleBufferHeader2 * SndDoubleBufferHeader2Ptr
  623.  
  624. SoundInfoList            RECORD 0
  625. count                     ds.w    1                ; offset: $0 (0)
  626. infoHandle                 ds.l    1                ; offset: $2 (2)
  627. sizeof                     EQU *                    ; size:   $6 (6)
  628.                         ENDR
  629. ; typedef struct SoundInfoList *        SoundInfoListPtr
  630.  
  631. SoundComponentData        RECORD 0
  632. flags                     ds.l    1                ; offset: $0 (0)
  633. format                     ds.l    1                ; offset: $4 (4)
  634. numChannels                 ds.w    1                ; offset: $8 (8)
  635. sampleSize                 ds.w    1                ; offset: $A (10)
  636. sampleRate                 ds.l    1                ; offset: $C (12)
  637. sampleCount                 ds.l    1                ; offset: $10 (16)
  638. buffer                     ds.l    1                ; offset: $14 (20)
  639. reserved                 ds.l    1                ; offset: $18 (24)
  640. sizeof                     EQU *                    ; size:   $1C (28)
  641.                         ENDR
  642. ; typedef struct SoundComponentData *    SoundComponentDataPtr
  643.  
  644.  
  645.  
  646. ; typedef SoundParamBlock *                SoundParamBlockPtr
  647.  
  648. SoundParamBlock            RECORD 0
  649. recordSize                 ds.l    1                ; offset: $0 (0)        ; size of this record in bytes
  650. desc                     ds        SoundComponentData ; offset: $4 (4)        ; description of sound buffer
  651. rateMultiplier             ds.l    1                ; offset: $20 (32)        ; rate multiplier to apply to sound
  652. leftVolume                 ds.w    1                ; offset: $24 (36)        ; volumes to apply to sound
  653. rightVolume                 ds.w    1                ; offset: $26 (38)
  654. quality                     ds.l    1                ; offset: $28 (40)        ; quality to apply to sound
  655. filter                     ds.l    1                ; offset: $2C (44)        ; filter to apply to sound
  656. moreRtn                     ds.l    1                ; offset: $30 (48)        ; routine to call to get more data
  657. completionRtn             ds.l    1                ; offset: $34 (52)        ; routine to call when buffer is complete
  658. refCon                     ds.l    1                ; offset: $38 (56)        ; user refcon
  659. result                     ds.w    1                ; offset: $3C (60)        ; result
  660. sizeof                     EQU *                    ; size:   $3E (62)
  661.                         ENDR
  662. CompressionInfo            RECORD 0
  663. recordSize                 ds.l    1                ; offset: $0 (0)
  664. format                     ds.l    1                ; offset: $4 (4)
  665. compressionID             ds.w    1                ; offset: $8 (8)
  666. samplesPerPacket         ds.w    1                ; offset: $A (10)
  667. bytesPerPacket             ds.w    1                ; offset: $C (12)
  668. bytesPerFrame             ds.w    1                ; offset: $E (14)
  669. bytesPerSample             ds.w    1                ; offset: $10 (16)
  670. futureUse1                 ds.w    1                ; offset: $12 (18)
  671. sizeof                     EQU *                    ; size:   $14 (20)
  672.                         ENDR
  673. ; typedef struct CompressionInfo *        CompressionInfoPtr
  674.  
  675. ; typedef CompressionInfoPtr *            CompressionInfoHandle
  676.  
  677. ; private thing to use as a reference to a Sound Converter
  678.  
  679.  
  680. ; private thing to use as a reference to a Sound Source
  681.  
  682.  
  683. ; typedef SoundSource *                    SoundSourcePtr
  684.  
  685. SoundComponentLink        RECORD 0
  686. description                 ds        ComponentDescription ; offset: $0 (0)    ; Describes the sound component
  687. mixerID                     ds.l    1                ; offset: $14 (20)        ; Reserved by Apple
  688. linkID                     ds.l    1                ; offset: $18 (24)        ; Reserved by Apple
  689. sizeof                     EQU *                    ; size:   $1C (28)
  690.                         ENDR
  691. ; typedef struct SoundComponentLink *    SoundComponentLinkPtr
  692.  
  693. AudioInfo                RECORD 0
  694. capabilitiesFlags         ds.l    1                ; offset: $0 (0)        ; Describes device capabilities
  695. reserved                 ds.l    1                ; offset: $4 (4)        ; Reserved by Apple
  696. numVolumeSteps             ds.w    1                ; offset: $8 (8)        ; Number of significant increments between min and max volume
  697. sizeof                     EQU *                    ; size:   $A (10)
  698.                         ENDR
  699. ; typedef struct AudioInfo *            AudioInfoPtr
  700.  
  701.  
  702.  
  703. ;   These two routines for Get/SetSoundVol should no longer be used.
  704. ;   They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  705. ;   Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  706.  
  707.  
  708.  
  709.     IF OLDROUTINENAMES ** TARGET_CPU_68K THEN
  710. ;
  711. ; pascal void SetSoundVol(short level)
  712. ;
  713.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  714.         IMPORT_CFM_FUNCTION SetSoundVol
  715.     ENDIF
  716.  
  717.  
  718. ;
  719. ; pascal void GetSoundVol(short *level)
  720. ;
  721.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  722.         ; parameters:
  723.         ;    level           => A0
  724.         Macro
  725.         _GetSoundVol
  726.             clr.b               (A0)+
  727.             move.b              $0260,(A0)
  728.         EndM
  729.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  730.         IMPORT_CFM_FUNCTION GetSoundVol
  731.     ENDIF
  732.  
  733.     ENDIF
  734. ;  Sound Input Structures
  735.  
  736.  
  737. ; typedef SPB *                            SPBPtr
  738.  
  739. ; user procedures called by sound input routines
  740. ; Sound Input Parameter Block
  741. SPB                        RECORD 0
  742. inRefNum                 ds.l    1                ; offset: $0 (0)        ; reference number of sound input device
  743. count                     ds.l    1                ; offset: $4 (4)        ; number of bytes to record
  744. milliseconds             ds.l    1                ; offset: $8 (8)        ; number of milliseconds to record
  745. bufferLength             ds.l    1                ; offset: $C (12)        ; length of buffer in bytes
  746. bufferPtr                 ds.l    1                ; offset: $10 (16)        ; buffer to store sound data in
  747. completionRoutine         ds.l    1                ; offset: $14 (20)        ; completion routine
  748. interruptRoutine         ds.l    1                ; offset: $18 (24)        ; interrupt routine
  749. userLong                 ds.l    1                ; offset: $1C (28)        ; user-defined field
  750. error                     ds.w    1                ; offset: $20 (32)        ; error
  751. unused1                     ds.l    1                ; offset: $22 (34)        ; reserved - must be zero
  752. sizeof                     EQU *                    ; size:   $26 (38)
  753.                         ENDR
  754.  
  755. ;  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  756. ;   functions for sound components
  757. ;  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  758.  
  759.  
  760. ; Sound Component Dispatch Selectors
  761.  
  762. kSoundComponentInitOutputDeviceSelect EQU 1                    ;these calls cannot be delegated
  763. kSoundComponentSetSourceSelect    EQU        2
  764. kSoundComponentGetSourceSelect    EQU        3
  765. kSoundComponentGetSourceDataSelect EQU    4
  766. kSoundComponentSetOutputSelect    EQU        5
  767. kDelegatedSoundComponentSelectors EQU    $0100                ;first selector that can be delegated up the chain
  768.                                                             ;these calls can be delegated and have own range
  769. kSoundComponentAddSourceSelect    EQU        $0101
  770. kSoundComponentRemoveSourceSelect EQU    $0102
  771. kSoundComponentGetInfoSelect    EQU        $0103
  772. kSoundComponentSetInfoSelect    EQU        $0104
  773. kSoundComponentStartSourceSelect EQU    $0105
  774. kSoundComponentStopSourceSelect    EQU        $0106
  775. kSoundComponentPauseSourceSelect EQU    $0107
  776. kSoundComponentPlaySourceBufferSelect EQU $0108
  777. ; Audio Component selectors
  778.  
  779. kAudioGetVolumeSelect            EQU        0
  780. kAudioSetVolumeSelect            EQU        1
  781. kAudioGetMuteSelect                EQU        2
  782. kAudioSetMuteSelect                EQU        3
  783. kAudioSetToDefaultsSelect        EQU        4
  784. kAudioGetInfoSelect                EQU        5
  785. kAudioGetBassSelect                EQU        6
  786. kAudioSetBassSelect                EQU        7
  787. kAudioGetTrebleSelect            EQU        8
  788. kAudioSetTrebleSelect            EQU        9
  789. kAudioGetOutputDeviceSelect        EQU        10
  790. kAudioMuteOnEventSelect            EQU        129
  791.  
  792. ;  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  793. ;   prototypes
  794. ;  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  795.  
  796.  
  797.  
  798. ;  Sound Manager routines 
  799. ;
  800. ; pascal void SysBeep(short duration)
  801. ;
  802.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  803.         _SysBeep:    OPWORD    $A9C8
  804.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  805.         IMPORT_CFM_FUNCTION SysBeep
  806.     ENDIF
  807.  
  808. ;
  809. ; pascal OSErr SndDoCommand(SndChannelPtr chan, const SndCommand *cmd, Boolean noWait)
  810. ;
  811.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  812.         _SndDoCommand:    OPWORD    $A803
  813.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  814.         IMPORT_CFM_FUNCTION SndDoCommand
  815.     ENDIF
  816.  
  817. ;
  818. ; pascal OSErr SndDoImmediate(SndChannelPtr chan, const SndCommand *cmd)
  819. ;
  820.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  821.         _SndDoImmediate:    OPWORD    $A804
  822.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  823.         IMPORT_CFM_FUNCTION SndDoImmediate
  824.     ENDIF
  825.  
  826. ;
  827. ; pascal OSErr SndNewChannel(SndChannelPtr *chan, short synth, long init, SndCallBackUPP userRoutine)
  828. ;
  829.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  830.         _SndNewChannel:    OPWORD    $A807
  831.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  832.         IMPORT_CFM_FUNCTION SndNewChannel
  833.     ENDIF
  834.  
  835. ;
  836. ; pascal OSErr SndDisposeChannel(SndChannelPtr chan, Boolean quietNow)
  837. ;
  838.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  839.         _SndDisposeChannel:    OPWORD    $A801
  840.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  841.         IMPORT_CFM_FUNCTION SndDisposeChannel
  842.     ENDIF
  843.  
  844. ;
  845. ; pascal OSErr SndPlay(SndChannelPtr chan, SndListHandle sndHandle, Boolean async)
  846. ;
  847.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  848.         _SndPlay:    OPWORD    $A805
  849.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  850.         IMPORT_CFM_FUNCTION SndPlay
  851.     ENDIF
  852.  
  853.     IF OLDROUTINENAMES THEN
  854. ;
  855. ; pascal OSErr SndAddModifier(SndChannelPtr chan, Ptr modifier, short id, long init)
  856. ;
  857.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  858.         _SndAddModifier:    OPWORD    $A802
  859.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  860.         IMPORT_CFM_FUNCTION SndAddModifier
  861.     ENDIF
  862.  
  863.     ENDIF    ; OLDROUTINENAMES
  864. ;
  865. ; pascal OSErr SndControl(short id, SndCommand *cmd)
  866. ;
  867.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  868.         _SndControl:    OPWORD    $A806
  869.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  870.         IMPORT_CFM_FUNCTION SndControl
  871.     ENDIF
  872.  
  873. ;  Sound Manager 2.0 and later, uses _SoundDispatch 
  874. ;
  875. ; pascal NumVersion SndSoundManagerVersion(void )
  876. ;
  877.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  878.         Macro
  879.         _SndSoundManagerVersion
  880.             move.l              #$000C0008,D0
  881.             dc.w                $A800
  882.         EndM
  883.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  884.         IMPORT_CFM_FUNCTION SndSoundManagerVersion
  885.     ENDIF
  886.  
  887. ;
  888. ; pascal OSErr SndStartFilePlay(SndChannelPtr chan, short fRefNum, short resNum, long bufferSize, void *theBuffer, AudioSelectionPtr theSelection, FilePlayCompletionUPP theCompletion, Boolean async)
  889. ;
  890.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  891.         Macro
  892.         _SndStartFilePlay
  893.             move.l              #$0D000008,D0
  894.             dc.w                $A800
  895.         EndM
  896.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  897.         IMPORT_CFM_FUNCTION SndStartFilePlay
  898.     ENDIF
  899.  
  900. ;
  901. ; pascal OSErr SndPauseFilePlay(SndChannelPtr chan)
  902. ;
  903.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  904.         Macro
  905.         _SndPauseFilePlay
  906.             move.l              #$02040008,D0
  907.             dc.w                $A800
  908.         EndM
  909.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  910.         IMPORT_CFM_FUNCTION SndPauseFilePlay
  911.     ENDIF
  912.  
  913. ;
  914. ; pascal OSErr SndStopFilePlay(SndChannelPtr chan, Boolean quietNow)
  915. ;
  916.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  917.         Macro
  918.         _SndStopFilePlay
  919.             move.l              #$03080008,D0
  920.             dc.w                $A800
  921.         EndM
  922.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  923.         IMPORT_CFM_FUNCTION SndStopFilePlay
  924.     ENDIF
  925.  
  926. ;
  927. ; pascal OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus)
  928. ;
  929.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  930.         Macro
  931.         _SndChannelStatus
  932.             move.l              #$05100008,D0
  933.             dc.w                $A800
  934.         EndM
  935.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  936.         IMPORT_CFM_FUNCTION SndChannelStatus
  937.     ENDIF
  938.  
  939. ;
  940. ; pascal OSErr SndManagerStatus(short theLength, SMStatusPtr theStatus)
  941. ;
  942.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  943.         Macro
  944.         _SndManagerStatus
  945.             move.l              #$03140008,D0
  946.             dc.w                $A800
  947.         EndM
  948.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  949.         IMPORT_CFM_FUNCTION SndManagerStatus
  950.     ENDIF
  951.  
  952. ;
  953. ; pascal void SndGetSysBeepState(short *sysBeepState)
  954. ;
  955.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  956.         Macro
  957.         _SndGetSysBeepState
  958.             move.l              #$02180008,D0
  959.             dc.w                $A800
  960.         EndM
  961.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  962.         IMPORT_CFM_FUNCTION SndGetSysBeepState
  963.     ENDIF
  964.  
  965. ;
  966. ; pascal OSErr SndSetSysBeepState(short sysBeepState)
  967. ;
  968.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  969.         Macro
  970.         _SndSetSysBeepState
  971.             move.l              #$011C0008,D0
  972.             dc.w                $A800
  973.         EndM
  974.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  975.         IMPORT_CFM_FUNCTION SndSetSysBeepState
  976.     ENDIF
  977.  
  978. ;
  979. ; pascal OSErr SndPlayDoubleBuffer(SndChannelPtr chan, SndDoubleBufferHeaderPtr theParams)
  980. ;
  981.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  982.         Macro
  983.         _SndPlayDoubleBuffer
  984.             move.l              #$04200008,D0
  985.             dc.w                $A800
  986.         EndM
  987.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  988.         IMPORT_CFM_FUNCTION SndPlayDoubleBuffer
  989.     ENDIF
  990.  
  991. ;  MACE compression routines 
  992. ;
  993. ; pascal NumVersion MACEVersion(void )
  994. ;
  995.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  996.         Macro
  997.         _MACEVersion
  998.             move.l              #$00000010,D0
  999.             dc.w                $A800
  1000.         EndM
  1001.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1002.         IMPORT_CFM_FUNCTION MACEVersion
  1003.     ENDIF
  1004.  
  1005. ;
  1006. ; pascal void Comp3to1(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  1007. ;
  1008.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1009.         Macro
  1010.         _Comp3to1
  1011.             move.l              #$00040010,D0
  1012.             dc.w                $A800
  1013.         EndM
  1014.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1015.         IMPORT_CFM_FUNCTION Comp3to1
  1016.     ENDIF
  1017.  
  1018. ;
  1019. ; pascal void Exp1to3(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  1020. ;
  1021.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1022.         Macro
  1023.         _Exp1to3
  1024.             move.l              #$00080010,D0
  1025.             dc.w                $A800
  1026.         EndM
  1027.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1028.         IMPORT_CFM_FUNCTION Exp1to3
  1029.     ENDIF
  1030.  
  1031. ;
  1032. ; pascal void Comp6to1(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  1033. ;
  1034.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1035.         Macro
  1036.         _Comp6to1
  1037.             move.l              #$000C0010,D0
  1038.             dc.w                $A800
  1039.         EndM
  1040.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1041.         IMPORT_CFM_FUNCTION Comp6to1
  1042.     ENDIF
  1043.  
  1044. ;
  1045. ; pascal void Exp1to6(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  1046. ;
  1047.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1048.         Macro
  1049.         _Exp1to6
  1050.             move.l              #$00100010,D0
  1051.             dc.w                $A800
  1052.         EndM
  1053.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1054.         IMPORT_CFM_FUNCTION Exp1to6
  1055.     ENDIF
  1056.  
  1057. ;  Sound Manager 3.0 and later calls 
  1058. ;
  1059. ; pascal OSErr GetSysBeepVolume(long *level)
  1060. ;
  1061.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1062.         Macro
  1063.         _GetSysBeepVolume
  1064.             move.l              #$02240018,D0
  1065.             dc.w                $A800
  1066.         EndM
  1067.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1068.         IMPORT_CFM_FUNCTION GetSysBeepVolume
  1069.     ENDIF
  1070.  
  1071. ;
  1072. ; pascal OSErr SetSysBeepVolume(long level)
  1073. ;
  1074.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1075.         Macro
  1076.         _SetSysBeepVolume
  1077.             move.l              #$02280018,D0
  1078.             dc.w                $A800
  1079.         EndM
  1080.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1081.         IMPORT_CFM_FUNCTION SetSysBeepVolume
  1082.     ENDIF
  1083.  
  1084. ;
  1085. ; pascal OSErr GetDefaultOutputVolume(long *level)
  1086. ;
  1087.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1088.         Macro
  1089.         _GetDefaultOutputVolume
  1090.             move.l              #$022C0018,D0
  1091.             dc.w                $A800
  1092.         EndM
  1093.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1094.         IMPORT_CFM_FUNCTION GetDefaultOutputVolume
  1095.     ENDIF
  1096.  
  1097. ;
  1098. ; pascal OSErr SetDefaultOutputVolume(long level)
  1099. ;
  1100.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1101.         Macro
  1102.         _SetDefaultOutputVolume
  1103.             move.l              #$02300018,D0
  1104.             dc.w                $A800
  1105.         EndM
  1106.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1107.         IMPORT_CFM_FUNCTION SetDefaultOutputVolume
  1108.     ENDIF
  1109.  
  1110. ;
  1111. ; pascal OSErr GetSoundHeaderOffset(SndListHandle sndHandle, long *offset)
  1112. ;
  1113.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1114.         Macro
  1115.         _GetSoundHeaderOffset
  1116.             move.l              #$04040018,D0
  1117.             dc.w                $A800
  1118.         EndM
  1119.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1120.         IMPORT_CFM_FUNCTION GetSoundHeaderOffset
  1121.     ENDIF
  1122.  
  1123. ;
  1124. ; pascal UnsignedFixed UnsignedFixedMulDiv(UnsignedFixed value, UnsignedFixed multiplier, UnsignedFixed divisor)
  1125. ;
  1126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1127.         Macro
  1128.         _UnsignedFixedMulDiv
  1129.             move.l              #$060C0018,D0
  1130.             dc.w                $A800
  1131.         EndM
  1132.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1133.         IMPORT_CFM_FUNCTION UnsignedFixedMulDiv
  1134.     ENDIF
  1135.  
  1136. ;
  1137. ; pascal OSErr GetCompressionInfo(short compressionID, OSType format, short numChannels, short sampleSize, CompressionInfoPtr cp)
  1138. ;
  1139.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1140.         Macro
  1141.         _GetCompressionInfo
  1142.             move.l              #$07100018,D0
  1143.             dc.w                $A800
  1144.         EndM
  1145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1146.         IMPORT_CFM_FUNCTION GetCompressionInfo
  1147.     ENDIF
  1148.  
  1149. ;
  1150. ; pascal OSErr SetSoundPreference(OSType theType, Str255 name, Handle settings)
  1151. ;
  1152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1153.         Macro
  1154.         _SetSoundPreference
  1155.             move.l              #$06340018,D0
  1156.             dc.w                $A800
  1157.         EndM
  1158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1159.         IMPORT_CFM_FUNCTION SetSoundPreference
  1160.     ENDIF
  1161.  
  1162. ;
  1163. ; pascal OSErr GetSoundPreference(OSType theType, Str255 name, Handle settings)
  1164. ;
  1165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1166.         Macro
  1167.         _GetSoundPreference
  1168.             move.l              #$06380018,D0
  1169.             dc.w                $A800
  1170.         EndM
  1171.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1172.         IMPORT_CFM_FUNCTION GetSoundPreference
  1173.     ENDIF
  1174.  
  1175. ;
  1176. ; pascal OSErr OpenMixerSoundComponent(SoundComponentDataPtr outputDescription, long outputFlags, ComponentInstance *mixerComponent)
  1177. ;
  1178.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1179.         Macro
  1180.         _OpenMixerSoundComponent
  1181.             move.l              #$06140018,D0
  1182.             dc.w                $A800
  1183.         EndM
  1184.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1185.         IMPORT_CFM_FUNCTION OpenMixerSoundComponent
  1186.     ENDIF
  1187.  
  1188. ;
  1189. ; pascal OSErr CloseMixerSoundComponent(ComponentInstance ci)
  1190. ;
  1191.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1192.         Macro
  1193.         _CloseMixerSoundComponent
  1194.             move.l              #$02180018,D0
  1195.             dc.w                $A800
  1196.         EndM
  1197.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1198.         IMPORT_CFM_FUNCTION CloseMixerSoundComponent
  1199.     ENDIF
  1200.  
  1201. ;  Sound Manager 3.1 and later calls 
  1202. ;
  1203. ; pascal OSErr SndGetInfo(SndChannelPtr chan, OSType selector, void *infoPtr)
  1204. ;
  1205.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1206.         Macro
  1207.         _SndGetInfo
  1208.             move.l              #$063C0018,D0
  1209.             dc.w                $A800
  1210.         EndM
  1211.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1212.         IMPORT_CFM_FUNCTION SndGetInfo
  1213.     ENDIF
  1214.  
  1215. ;
  1216. ; pascal OSErr SndSetInfo(SndChannelPtr chan, OSType selector, const void *infoPtr)
  1217. ;
  1218.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1219.         Macro
  1220.         _SndSetInfo
  1221.             move.l              #$06400018,D0
  1222.             dc.w                $A800
  1223.         EndM
  1224.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1225.         IMPORT_CFM_FUNCTION SndSetInfo
  1226.     ENDIF
  1227.  
  1228. ;
  1229. ; pascal OSErr GetSoundOutputInfo(Component outputDevice, OSType selector, void *infoPtr)
  1230. ;
  1231.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1232.         Macro
  1233.         _GetSoundOutputInfo
  1234.             move.l              #$06440018,D0
  1235.             dc.w                $A800
  1236.         EndM
  1237.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1238.         IMPORT_CFM_FUNCTION GetSoundOutputInfo
  1239.     ENDIF
  1240.  
  1241. ;
  1242. ; pascal OSErr SetSoundOutputInfo(Component outputDevice, OSType selector, const void *infoPtr)
  1243. ;
  1244.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1245.         Macro
  1246.         _SetSoundOutputInfo
  1247.             move.l              #$06480018,D0
  1248.             dc.w                $A800
  1249.         EndM
  1250.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1251.         IMPORT_CFM_FUNCTION SetSoundOutputInfo
  1252.     ENDIF
  1253.  
  1254. ;  Sound Manager 3.2 and later calls 
  1255. ;
  1256. ; pascal OSErr GetCompressionName(OSType compressionType, Str255 compressionName)
  1257. ;
  1258.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1259.         Macro
  1260.         _GetCompressionName
  1261.             move.l              #$044C0018,D0
  1262.             dc.w                $A800
  1263.         EndM
  1264.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1265.         IMPORT_CFM_FUNCTION GetCompressionName
  1266.     ENDIF
  1267.  
  1268. ;
  1269. ; pascal OSErr SoundConverterOpen(const SoundComponentData *inputFormat, const SoundComponentData *outputFormat, SoundConverter *sc)
  1270. ;
  1271.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1272.         Macro
  1273.         _SoundConverterOpen
  1274.             move.l              #$06500018,D0
  1275.             dc.w                $A800
  1276.         EndM
  1277.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1278.         IMPORT_CFM_FUNCTION SoundConverterOpen
  1279.     ENDIF
  1280.  
  1281. ;
  1282. ; pascal OSErr SoundConverterClose(SoundConverter sc)
  1283. ;
  1284.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1285.         Macro
  1286.         _SoundConverterClose
  1287.             move.l              #$02540018,D0
  1288.             dc.w                $A800
  1289.         EndM
  1290.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1291.         IMPORT_CFM_FUNCTION SoundConverterClose
  1292.     ENDIF
  1293.  
  1294. ;
  1295. ; pascal OSErr SoundConverterGetBufferSizes(SoundConverter sc, unsigned long inputBytesTarget, unsigned long *inputFrames, unsigned long *inputBytes, unsigned long *outputBytes)
  1296. ;
  1297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1298.         Macro
  1299.         _SoundConverterGetBufferSizes
  1300.             move.l              #$0A580018,D0
  1301.             dc.w                $A800
  1302.         EndM
  1303.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1304.         IMPORT_CFM_FUNCTION SoundConverterGetBufferSizes
  1305.     ENDIF
  1306.  
  1307. ;
  1308. ; pascal OSErr SoundConverterBeginConversion(SoundConverter sc)
  1309. ;
  1310.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1311.         Macro
  1312.         _SoundConverterBeginConversion
  1313.             move.l              #$025C0018,D0
  1314.             dc.w                $A800
  1315.         EndM
  1316.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1317.         IMPORT_CFM_FUNCTION SoundConverterBeginConversion
  1318.     ENDIF
  1319.  
  1320. ;
  1321. ; pascal OSErr SoundConverterConvertBuffer(SoundConverter sc, const void *inputPtr, unsigned long inputFrames, void *outputPtr, unsigned long *outputFrames, unsigned long *outputBytes)
  1322. ;
  1323.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1324.         Macro
  1325.         _SoundConverterConvertBuffer
  1326.             move.l              #$0C600018,D0
  1327.             dc.w                $A800
  1328.         EndM
  1329.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1330.         IMPORT_CFM_FUNCTION SoundConverterConvertBuffer
  1331.     ENDIF
  1332.  
  1333. ;
  1334. ; pascal OSErr SoundConverterEndConversion(SoundConverter sc, void *outputPtr, unsigned long *outputFrames, unsigned long *outputBytes)
  1335. ;
  1336.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1337.         Macro
  1338.         _SoundConverterEndConversion
  1339.             move.l              #$08640018,D0
  1340.             dc.w                $A800
  1341.         EndM
  1342.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1343.         IMPORT_CFM_FUNCTION SoundConverterEndConversion
  1344.     ENDIF
  1345.  
  1346.  
  1347. ;  Sound Component Functions
  1348. ;   basic sound component functions
  1349.  
  1350.  
  1351. ;
  1352. ; pascal ComponentResult SoundComponentInitOutputDevice(ComponentInstance ti, long actions)
  1353. ;
  1354.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1355.         Macro
  1356.         _SoundComponentInitOutputDevice
  1357.             move.l              #$00040001,-(sp)
  1358.             moveq               #0,D0
  1359.             dc.w                $A82A
  1360.         EndM
  1361.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1362.         IMPORT_CFM_FUNCTION SoundComponentInitOutputDevice
  1363.     ENDIF
  1364.  
  1365. ;
  1366. ; pascal ComponentResult SoundComponentSetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance source)
  1367. ;
  1368.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1369.         Macro
  1370.         _SoundComponentSetSource
  1371.             move.l              #$00080002,-(sp)
  1372.             moveq               #0,D0
  1373.             dc.w                $A82A
  1374.         EndM
  1375.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1376.         IMPORT_CFM_FUNCTION SoundComponentSetSource
  1377.     ENDIF
  1378.  
  1379. ;
  1380. ; pascal ComponentResult SoundComponentGetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance *source)
  1381. ;
  1382.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1383.         Macro
  1384.         _SoundComponentGetSource
  1385.             move.l              #$00080003,-(sp)
  1386.             moveq               #0,D0
  1387.             dc.w                $A82A
  1388.         EndM
  1389.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1390.         IMPORT_CFM_FUNCTION SoundComponentGetSource
  1391.     ENDIF
  1392.  
  1393. ;
  1394. ; pascal ComponentResult SoundComponentGetSourceData(ComponentInstance ti, SoundComponentDataPtr *sourceData)
  1395. ;
  1396.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1397.         Macro
  1398.         _SoundComponentGetSourceData
  1399.             move.l              #$00040004,-(sp)
  1400.             moveq               #0,D0
  1401.             dc.w                $A82A
  1402.         EndM
  1403.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1404.         IMPORT_CFM_FUNCTION SoundComponentGetSourceData
  1405.     ENDIF
  1406.  
  1407. ;
  1408. ; pascal ComponentResult SoundComponentSetOutput(ComponentInstance ti, SoundComponentDataPtr requested, SoundComponentDataPtr *actual)
  1409. ;
  1410.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1411.         Macro
  1412.         _SoundComponentSetOutput
  1413.             move.l              #$00080005,-(sp)
  1414.             moveq               #0,D0
  1415.             dc.w                $A82A
  1416.         EndM
  1417.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1418.         IMPORT_CFM_FUNCTION SoundComponentSetOutput
  1419.     ENDIF
  1420.  
  1421. ;  junction methods for the mixer, must be called at non-interrupt level
  1422. ;
  1423. ; pascal ComponentResult SoundComponentAddSource(ComponentInstance ti, SoundSource *sourceID)
  1424. ;
  1425.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1426.         Macro
  1427.         _SoundComponentAddSource
  1428.             move.l              #$00040101,-(sp)
  1429.             moveq               #0,D0
  1430.             dc.w                $A82A
  1431.         EndM
  1432.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1433.         IMPORT_CFM_FUNCTION SoundComponentAddSource
  1434.     ENDIF
  1435.  
  1436. ;
  1437. ; pascal ComponentResult SoundComponentRemoveSource(ComponentInstance ti, SoundSource sourceID)
  1438. ;
  1439.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1440.         Macro
  1441.         _SoundComponentRemoveSource
  1442.             move.l              #$00040102,-(sp)
  1443.             moveq               #0,D0
  1444.             dc.w                $A82A
  1445.         EndM
  1446.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1447.         IMPORT_CFM_FUNCTION SoundComponentRemoveSource
  1448.     ENDIF
  1449.  
  1450. ;  info methods
  1451. ;
  1452. ; pascal ComponentResult SoundComponentGetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  1453. ;
  1454.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1455.         Macro
  1456.         _SoundComponentGetInfo
  1457.             move.l              #$000C0103,-(sp)
  1458.             moveq               #0,D0
  1459.             dc.w                $A82A
  1460.         EndM
  1461.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1462.         IMPORT_CFM_FUNCTION SoundComponentGetInfo
  1463.     ENDIF
  1464.  
  1465. ;
  1466. ; pascal ComponentResult SoundComponentSetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  1467. ;
  1468.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1469.         Macro
  1470.         _SoundComponentSetInfo
  1471.             move.l              #$000C0104,-(sp)
  1472.             moveq               #0,D0
  1473.             dc.w                $A82A
  1474.         EndM
  1475.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1476.         IMPORT_CFM_FUNCTION SoundComponentSetInfo
  1477.     ENDIF
  1478.  
  1479. ;  control methods
  1480. ;
  1481. ; pascal ComponentResult SoundComponentStartSource(ComponentInstance ti, short count, SoundSource *sources)
  1482. ;
  1483.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1484.         Macro
  1485.         _SoundComponentStartSource
  1486.             move.l              #$00060105,-(sp)
  1487.             moveq               #0,D0
  1488.             dc.w                $A82A
  1489.         EndM
  1490.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1491.         IMPORT_CFM_FUNCTION SoundComponentStartSource
  1492.     ENDIF
  1493.  
  1494. ;
  1495. ; pascal ComponentResult SoundComponentStopSource(ComponentInstance ti, short count, SoundSource *sources)
  1496. ;
  1497.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1498.         Macro
  1499.         _SoundComponentStopSource
  1500.             move.l              #$00060106,-(sp)
  1501.             moveq               #0,D0
  1502.             dc.w                $A82A
  1503.         EndM
  1504.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1505.         IMPORT_CFM_FUNCTION SoundComponentStopSource
  1506.     ENDIF
  1507.  
  1508. ;
  1509. ; pascal ComponentResult SoundComponentPauseSource(ComponentInstance ti, short count, SoundSource *sources)
  1510. ;
  1511.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1512.         Macro
  1513.         _SoundComponentPauseSource
  1514.             move.l              #$00060107,-(sp)
  1515.             moveq               #0,D0
  1516.             dc.w                $A82A
  1517.         EndM
  1518.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1519.         IMPORT_CFM_FUNCTION SoundComponentPauseSource
  1520.     ENDIF
  1521.  
  1522. ;
  1523. ; pascal ComponentResult SoundComponentPlaySourceBuffer(ComponentInstance ti, SoundSource sourceID, SoundParamBlockPtr pb, long actions)
  1524. ;
  1525.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1526.         Macro
  1527.         _SoundComponentPlaySourceBuffer
  1528.             move.l              #$000C0108,-(sp)
  1529.             moveq               #0,D0
  1530.             dc.w                $A82A
  1531.         EndM
  1532.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1533.         IMPORT_CFM_FUNCTION SoundComponentPlaySourceBuffer
  1534.     ENDIF
  1535.  
  1536. ; Audio Components
  1537. ; Volume is described as a value between 0 and 1, with 0 indicating minimum
  1538. ;  volume and 1 indicating maximum volume; if the device doesn't support
  1539. ;  software control of volume, then a value of unimpErr is returned, indicating
  1540. ;  that these functions are not supported by the device
  1541.  
  1542. ;
  1543. ; pascal ComponentResult AudioGetVolume(ComponentInstance ac, short whichChannel, ShortFixed *volume)
  1544. ;
  1545.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1546.         Macro
  1547.         _AudioGetVolume
  1548.             move.l              #$00060000,-(sp)
  1549.             moveq               #0,D0
  1550.             dc.w                $A82A
  1551.         EndM
  1552.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1553.         IMPORT_CFM_FUNCTION AudioGetVolume
  1554.     ENDIF
  1555.  
  1556. ;
  1557. ; pascal ComponentResult AudioSetVolume(ComponentInstance ac, short whichChannel, ShortFixed volume)
  1558. ;
  1559.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1560.         Macro
  1561.         _AudioSetVolume
  1562.             move.l              #$00040001,-(sp)
  1563.             moveq               #0,D0
  1564.             dc.w                $A82A
  1565.         EndM
  1566.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1567.         IMPORT_CFM_FUNCTION AudioSetVolume
  1568.     ENDIF
  1569.  
  1570. ; If the device doesn't support software control of mute, then a value of unimpErr is
  1571. ;returned, indicating that these functions are not supported by the device.
  1572. ;
  1573. ; pascal ComponentResult AudioGetMute(ComponentInstance ac, short whichChannel, short *mute)
  1574. ;
  1575.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1576.         Macro
  1577.         _AudioGetMute
  1578.             move.l              #$00060002,-(sp)
  1579.             moveq               #0,D0
  1580.             dc.w                $A82A
  1581.         EndM
  1582.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1583.         IMPORT_CFM_FUNCTION AudioGetMute
  1584.     ENDIF
  1585.  
  1586. ;
  1587. ; pascal ComponentResult AudioSetMute(ComponentInstance ac, short whichChannel, short mute)
  1588. ;
  1589.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1590.         Macro
  1591.         _AudioSetMute
  1592.             move.l              #$00040003,-(sp)
  1593.             moveq               #0,D0
  1594.             dc.w                $A82A
  1595.         EndM
  1596.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1597.         IMPORT_CFM_FUNCTION AudioSetMute
  1598.     ENDIF
  1599.  
  1600. ; AudioSetToDefaults causes the associated device to reset its volume and mute values
  1601. ;(and perhaps other characteristics, e.g. attenuation) to "factory default" settings
  1602. ;
  1603. ; pascal ComponentResult AudioSetToDefaults(ComponentInstance ac)
  1604. ;
  1605.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1606.         Macro
  1607.         _AudioSetToDefaults
  1608.             move.l              #$00000004,-(sp)
  1609.             moveq               #0,D0
  1610.             dc.w                $A82A
  1611.         EndM
  1612.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1613.         IMPORT_CFM_FUNCTION AudioSetToDefaults
  1614.     ENDIF
  1615.  
  1616. ; This routine is required; it must be implemented by all audio components
  1617.  
  1618. ;
  1619. ; pascal ComponentResult AudioGetInfo(ComponentInstance ac, AudioInfoPtr info)
  1620. ;
  1621.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1622.         Macro
  1623.         _AudioGetInfo
  1624.             move.l              #$00040005,-(sp)
  1625.             moveq               #0,D0
  1626.             dc.w                $A82A
  1627.         EndM
  1628.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1629.         IMPORT_CFM_FUNCTION AudioGetInfo
  1630.     ENDIF
  1631.  
  1632. ;
  1633. ; pascal ComponentResult AudioGetBass(ComponentInstance ac, short whichChannel, short *bass)
  1634. ;
  1635.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1636.         Macro
  1637.         _AudioGetBass
  1638.             move.l              #$00060006,-(sp)
  1639.             moveq               #0,D0
  1640.             dc.w                $A82A
  1641.         EndM
  1642.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1643.         IMPORT_CFM_FUNCTION AudioGetBass
  1644.     ENDIF
  1645.  
  1646. ;
  1647. ; pascal ComponentResult AudioSetBass(ComponentInstance ac, short whichChannel, short bass)
  1648. ;
  1649.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1650.         Macro
  1651.         _AudioSetBass
  1652.             move.l              #$00040007,-(sp)
  1653.             moveq               #0,D0
  1654.             dc.w                $A82A
  1655.         EndM
  1656.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1657.         IMPORT_CFM_FUNCTION AudioSetBass
  1658.     ENDIF
  1659.  
  1660. ;
  1661. ; pascal ComponentResult AudioGetTreble(ComponentInstance ac, short whichChannel, short *Treble)
  1662. ;
  1663.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1664.         Macro
  1665.         _AudioGetTreble
  1666.             move.l              #$00060008,-(sp)
  1667.             moveq               #0,D0
  1668.             dc.w                $A82A
  1669.         EndM
  1670.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1671.         IMPORT_CFM_FUNCTION AudioGetTreble
  1672.     ENDIF
  1673.  
  1674. ;
  1675. ; pascal ComponentResult AudioSetTreble(ComponentInstance ac, short whichChannel, short Treble)
  1676. ;
  1677.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1678.         Macro
  1679.         _AudioSetTreble
  1680.             move.l              #$00040009,-(sp)
  1681.             moveq               #0,D0
  1682.             dc.w                $A82A
  1683.         EndM
  1684.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1685.         IMPORT_CFM_FUNCTION AudioSetTreble
  1686.     ENDIF
  1687.  
  1688. ;
  1689. ; pascal ComponentResult AudioGetOutputDevice(ComponentInstance ac, Component *outputDevice)
  1690. ;
  1691.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1692.         Macro
  1693.         _AudioGetOutputDevice
  1694.             move.l              #$0004000A,-(sp)
  1695.             moveq               #0,D0
  1696.             dc.w                $A82A
  1697.         EndM
  1698.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1699.         IMPORT_CFM_FUNCTION AudioGetOutputDevice
  1700.     ENDIF
  1701.  
  1702.  
  1703.  
  1704. ; This is routine is private to the AudioVision component.  It enables the watching of the mute key.
  1705. ;
  1706. ; pascal ComponentResult AudioMuteOnEvent(ComponentInstance ac, short muteOnEvent)
  1707. ;
  1708.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1709.         Macro
  1710.         _AudioMuteOnEvent
  1711.             move.l              #$00020081,-(sp)
  1712.             moveq               #0,D0
  1713.             dc.w                $A82A
  1714.         EndM
  1715.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1716.         IMPORT_CFM_FUNCTION AudioMuteOnEvent
  1717.     ENDIF
  1718.  
  1719. ;  Sound Input Manager routines 
  1720. ;
  1721. ; pascal NumVersion SPBVersion(void )
  1722. ;
  1723.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1724.         Macro
  1725.         _SPBVersion
  1726.             move.l              #$00000014,D0
  1727.             dc.w                $A800
  1728.         EndM
  1729.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1730.         IMPORT_CFM_FUNCTION SPBVersion
  1731.     ENDIF
  1732.  
  1733. ;
  1734. ; pascal OSErr SndRecord(ModalFilterUPP filterProc, Point corner, OSType quality, SndListHandle *sndHandle)
  1735. ;
  1736.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1737.         Macro
  1738.         _SndRecord
  1739.             move.l              #$08040014,D0
  1740.             dc.w                $A800
  1741.         EndM
  1742.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1743.         IMPORT_CFM_FUNCTION SndRecord
  1744.     ENDIF
  1745.  
  1746. ;
  1747. ; pascal OSErr SndRecordToFile(ModalFilterUPP filterProc, Point corner, OSType quality, short fRefNum)
  1748. ;
  1749.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1750.         Macro
  1751.         _SndRecordToFile
  1752.             move.l              #$07080014,D0
  1753.             dc.w                $A800
  1754.         EndM
  1755.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1756.         IMPORT_CFM_FUNCTION SndRecordToFile
  1757.     ENDIF
  1758.  
  1759. ;
  1760. ; pascal OSErr SPBSignInDevice(short deviceRefNum, ConstStr255Param deviceName)
  1761. ;
  1762.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1763.         Macro
  1764.         _SPBSignInDevice
  1765.             move.l              #$030C0014,D0
  1766.             dc.w                $A800
  1767.         EndM
  1768.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1769.         IMPORT_CFM_FUNCTION SPBSignInDevice
  1770.     ENDIF
  1771.  
  1772. ;
  1773. ; pascal OSErr SPBSignOutDevice(short deviceRefNum)
  1774. ;
  1775.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1776.         Macro
  1777.         _SPBSignOutDevice
  1778.             move.l              #$01100014,D0
  1779.             dc.w                $A800
  1780.         EndM
  1781.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1782.         IMPORT_CFM_FUNCTION SPBSignOutDevice
  1783.     ENDIF
  1784.  
  1785. ;
  1786. ; pascal OSErr SPBGetIndexedDevice(short count, Str255 deviceName, Handle *deviceIconHandle)
  1787. ;
  1788.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1789.         Macro
  1790.         _SPBGetIndexedDevice
  1791.             move.l              #$05140014,D0
  1792.             dc.w                $A800
  1793.         EndM
  1794.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1795.         IMPORT_CFM_FUNCTION SPBGetIndexedDevice
  1796.     ENDIF
  1797.  
  1798. ;
  1799. ; pascal OSErr SPBOpenDevice(ConstStr255Param deviceName, short permission, long *inRefNum)
  1800. ;
  1801.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1802.         Macro
  1803.         _SPBOpenDevice
  1804.             move.l              #$05180014,D0
  1805.             dc.w                $A800
  1806.         EndM
  1807.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1808.         IMPORT_CFM_FUNCTION SPBOpenDevice
  1809.     ENDIF
  1810.  
  1811. ;
  1812. ; pascal OSErr SPBCloseDevice(long inRefNum)
  1813. ;
  1814.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1815.         Macro
  1816.         _SPBCloseDevice
  1817.             move.l              #$021C0014,D0
  1818.             dc.w                $A800
  1819.         EndM
  1820.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1821.         IMPORT_CFM_FUNCTION SPBCloseDevice
  1822.     ENDIF
  1823.  
  1824. ;
  1825. ; pascal OSErr SPBRecord(SPBPtr inParamPtr, Boolean asynchFlag)
  1826. ;
  1827.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1828.         Macro
  1829.         _SPBRecord
  1830.             move.l              #$03200014,D0
  1831.             dc.w                $A800
  1832.         EndM
  1833.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1834.         IMPORT_CFM_FUNCTION SPBRecord
  1835.     ENDIF
  1836.  
  1837. ;
  1838. ; pascal OSErr SPBRecordToFile(short fRefNum, SPBPtr inParamPtr, Boolean asynchFlag)
  1839. ;
  1840.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1841.         Macro
  1842.         _SPBRecordToFile
  1843.             move.l              #$04240014,D0
  1844.             dc.w                $A800
  1845.         EndM
  1846.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1847.         IMPORT_CFM_FUNCTION SPBRecordToFile
  1848.     ENDIF
  1849.  
  1850. ;
  1851. ; pascal OSErr SPBPauseRecording(long inRefNum)
  1852. ;
  1853.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1854.         Macro
  1855.         _SPBPauseRecording
  1856.             move.l              #$02280014,D0
  1857.             dc.w                $A800
  1858.         EndM
  1859.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1860.         IMPORT_CFM_FUNCTION SPBPauseRecording
  1861.     ENDIF
  1862.  
  1863. ;
  1864. ; pascal OSErr SPBResumeRecording(long inRefNum)
  1865. ;
  1866.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1867.         Macro
  1868.         _SPBResumeRecording
  1869.             move.l              #$022C0014,D0
  1870.             dc.w                $A800
  1871.         EndM
  1872.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1873.         IMPORT_CFM_FUNCTION SPBResumeRecording
  1874.     ENDIF
  1875.  
  1876. ;
  1877. ; pascal OSErr SPBStopRecording(long inRefNum)
  1878. ;
  1879.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1880.         Macro
  1881.         _SPBStopRecording
  1882.             move.l              #$02300014,D0
  1883.             dc.w                $A800
  1884.         EndM
  1885.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1886.         IMPORT_CFM_FUNCTION SPBStopRecording
  1887.     ENDIF
  1888.  
  1889. ;
  1890. ; pascal OSErr SPBGetRecordingStatus(long inRefNum, short *recordingStatus, short *meterLevel, unsigned long *totalSamplesToRecord, unsigned long *numberOfSamplesRecorded, unsigned long *totalMsecsToRecord, unsigned long *numberOfMsecsRecorded)
  1891. ;
  1892.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1893.         Macro
  1894.         _SPBGetRecordingStatus
  1895.             move.l              #$0E340014,D0
  1896.             dc.w                $A800
  1897.         EndM
  1898.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1899.         IMPORT_CFM_FUNCTION SPBGetRecordingStatus
  1900.     ENDIF
  1901.  
  1902. ;
  1903. ; pascal OSErr SPBGetDeviceInfo(long inRefNum, OSType infoType, void *infoData)
  1904. ;
  1905.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1906.         Macro
  1907.         _SPBGetDeviceInfo
  1908.             move.l              #$06380014,D0
  1909.             dc.w                $A800
  1910.         EndM
  1911.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1912.         IMPORT_CFM_FUNCTION SPBGetDeviceInfo
  1913.     ENDIF
  1914.  
  1915. ;
  1916. ; pascal OSErr SPBSetDeviceInfo(long inRefNum, OSType infoType, void *infoData)
  1917. ;
  1918.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1919.         Macro
  1920.         _SPBSetDeviceInfo
  1921.             move.l              #$063C0014,D0
  1922.             dc.w                $A800
  1923.         EndM
  1924.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1925.         IMPORT_CFM_FUNCTION SPBSetDeviceInfo
  1926.     ENDIF
  1927.  
  1928. ;
  1929. ; pascal OSErr SPBMillisecondsToBytes(long inRefNum, long *milliseconds)
  1930. ;
  1931.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1932.         Macro
  1933.         _SPBMillisecondsToBytes
  1934.             move.l              #$04400014,D0
  1935.             dc.w                $A800
  1936.         EndM
  1937.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1938.         IMPORT_CFM_FUNCTION SPBMillisecondsToBytes
  1939.     ENDIF
  1940.  
  1941. ;
  1942. ; pascal OSErr SPBBytesToMilliseconds(long inRefNum, long *byteCount)
  1943. ;
  1944.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1945.         Macro
  1946.         _SPBBytesToMilliseconds
  1947.             move.l              #$04440014,D0
  1948.             dc.w                $A800
  1949.         EndM
  1950.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1951.         IMPORT_CFM_FUNCTION SPBBytesToMilliseconds
  1952.     ENDIF
  1953.  
  1954. ;
  1955. ; pascal OSErr SetupSndHeader(SndListHandle sndHandle, short numChannels, UnsignedFixed sampleRate, short sampleSize, OSType compressionType, short baseNote, unsigned long numBytes, short *headerLen)
  1956. ;
  1957.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1958.         Macro
  1959.         _SetupSndHeader
  1960.             move.l              #$0D480014,D0
  1961.             dc.w                $A800
  1962.         EndM
  1963.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1964.         IMPORT_CFM_FUNCTION SetupSndHeader
  1965.     ENDIF
  1966.  
  1967. ;
  1968. ; pascal OSErr SetupAIFFHeader(short fRefNum, short numChannels, UnsignedFixed sampleRate, short sampleSize, OSType compressionType, unsigned long numBytes, unsigned long numFrames)
  1969. ;
  1970.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1971.         Macro
  1972.         _SetupAIFFHeader
  1973.             move.l              #$0B4C0014,D0
  1974.             dc.w                $A800
  1975.         EndM
  1976.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1977.         IMPORT_CFM_FUNCTION SetupAIFFHeader
  1978.     ENDIF
  1979.  
  1980. ;  Sound Input Manager 1.1 and later calls 
  1981. ;
  1982. ; pascal OSErr ParseAIFFHeader(short fRefNum, SoundComponentData *sndInfo, unsigned long *numFrames, unsigned long *dataOffset)
  1983. ;
  1984.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1985.         Macro
  1986.         _ParseAIFFHeader
  1987.             move.l              #$07580014,D0
  1988.             dc.w                $A800
  1989.         EndM
  1990.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1991.         IMPORT_CFM_FUNCTION ParseAIFFHeader
  1992.     ENDIF
  1993.  
  1994. ;
  1995. ; pascal OSErr ParseSndHeader(SndListHandle sndHandle, SoundComponentData *sndInfo, unsigned long *numFrames, unsigned long *dataOffset)
  1996. ;
  1997.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1998.         Macro
  1999.         _ParseSndHeader
  2000.             move.l              #$085C0014,D0
  2001.             dc.w                $A800
  2002.         EndM
  2003.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2004.         IMPORT_CFM_FUNCTION ParseSndHeader
  2005.     ENDIF
  2006.  
  2007.  
  2008.  
  2009.     ENDIF ; __SOUND__ 
  2010.  
  2011.